<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">

  <div class="navbar-header">
    <%= link_to "二手房价格预测", root_path, method: :get, class: 'navbar-brand' %>
  </div>

  <div class="collapse navbar-collapse">
    <ul class="nav navbar-top-links navbar-right">

      <% if current_user.nil? %>
          <li>
            <button type="button" id="login_panel" class="btn btn-link navbar-btn">
              <span class="glyphicon glyphicon-log-in"></span> 登录
            </button>
          </li>

      <% else %>
          <li>
            <%= link_to sessions_logout_path, method: :delete do %>
                退出 <span class="	glyphicon glyphicon-off"></span>
            <% end %>
          </li>
      <% end %>

      <li> <%= link_to "码云仓库", 'https://gitee.com/CQU_WDD/HousePricing' %></li>

    </ul>
    <%= render 'layouts/navside' %>
  </div>
</nav>


<%= render "layouts/login_panel" %>

<script>
  $(document).ready(function () {
    $("#login_panel").click(function () {
      $("#panel_modal").modal();
    });
  });

</script>
